package com.ithuameng.admin.app.system.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ithuameng.admin.enums.YesNo;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 角色
 *
 * @author ithuameng
 */
@Data
@TableName("t_role")
@EqualsAndHashCode(callSuper = false)
public class Role extends AdminLogic<Long> {

    private static final long serialVersionUID = -3715946606337731989L;

    public static final String ROLE_KEY = "role_key";

    public static final String NAME = "name";

    public static final String SEQ = "seq";

    public static final String REMARK = "remark";

    public static final String STATUS = "status";

    public static final Long ADMIN_ID = 1L;

    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 角色权限
     */
    private String roleKey;

    /**
     * 角色名称
     */
    private String name;

    /**
     * 排序值
     */
    private Integer seq;

    /**
     * 角色描述
     */
    private String remark;

    /**
     * 状态
     */
    private YesNo status;

    public boolean isAdmin() {
        return ADMIN_ID.equals(this.id);
    }
}
